package org.example.nebula;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author: jszhang
 * @date: 2024/10/25-11:46
 */
@Slf4j
@SpringBootApplication
public class NebulaDataManageApp {

    public static void main(String[] args) throws UnknownHostException {
//        log.info("swagger接口地址：{}", "http://172.16.18.42:9600/ng/swagger-ui/index.html#/");

        ConfigurableApplicationContext run = SpringApplication.run(NebulaDataManageApp.class, args);

        Environment env = run.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application Jeecg-Boot is running! Access URLs:\n\t" +
                "Swagger-ui: \thttp://" + ip + ":" + port + path + "/swagger-ui/index.html\n\t" +
                "----------------------------------------------------------");
    }

}
